<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.d1{
				width: 200px;
				height: 200px;
				font-size: 14px;
				color: white;	
			}
		</style>
	</head>
	<body>
		<form action="" method="">
			属性名:<input type="text" class="im" value="background"/><br>
			属性值:<input type="text" class="iz" value="black"/><br>	
			<button type="button" class="yes">提交</button>
			<button type="reset" class="reset">重置</button>
		</form>
		<div class="d1">在上方输入框输入"属性名"及"属性值",点击确定查看效果</div>
		<script type="text/javascript">
			$(function(){
				$(".yes").click(function(){
					var im = $(".im").val();
					var iz = $(".iz").val();				
					$(".d1").css(im,iz);
				})
				$(".reset").click(function(){
					$(".d1").css("background","black");
				})
			})
		</script>
	</body>
</html>
